import Fetch from './http'
const fileApi = process.env.NODE_ENV === 'development' ? '/fileUpload' : process.env.VUE_APP_API_FILE_UPLOAD_BASE_URL
const filePreviewApi = process.env.NODE_ENV === 'development' ? '/filePreview' : process.env.VUE_APP_API_FILE_PREVIEW_BASE_URL

export const filePreviewUrl = filePreviewApi + ''
export const fileUploadUrl = `${fileApi}/minio/xihu`

// 上传一个文件（base64）
export const minioBase64 = (params, bucket) => {
  return Fetch({ url: `${fileApi}/minio/base64/${bucket}`, method: 'POST', params })
}
